﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using DomainDriver.DomainModeling.DomainObjects;
using ObjectRow = AutomotivePricingModel.AutomotivePricingDataSet.YearValueObservationsRow;

namespace AutomotivePricingModel.YearlyFinancialAssessments
{
    public partial class YearValueObservation
    {
        #region AutomotivePricingDataSet Serialization

        public void Serialize(AutomotivePricingDataSet datasource, ObjectRow objectRecord)
        {
            objectRecord.Value = m_Value;
            objectRecord.Year = m_Year;
            objectRecord.ParentYearlyFinancialAssessmentId = m_ParentYearlyFinancialAssessmentId;

            datasource.YearValueObservations.AddYearValueObservationsRow(objectRecord);
        }

        public void Deserialize(AutomotivePricingDataSet datasource, ObjectRow objectRecord)
        {
            m_Value = objectRecord.Value;
            m_Year = objectRecord.Year;
            m_ParentYearlyFinancialAssessmentId = objectRecord.ParentYearlyFinancialAssessmentId;
        }

        #endregion
    }
}